<?php
require_once "./db_config.php";
class DATA{
    public $count=0;
    public $data=[];
}
$data=new DATA;
if(isset($_POST['id'])){
    $id=$_POST['id'];
    if($id=="all"){
        $sql="SELECT * FROM transfer_history";
    }else{
        $sql="SELECT * FROM transfer_history WHERE id='$id'";
    }
    // echo $sql;
    $result=mysqli_query($conn,$sql);
    $data->count=mysqli_num_rows($result);
    if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_array($result)) {
            $arr[]=$row;
        }
        $data->data=$arr;
    } else {
        echo "0 结果";
    }
}
echo json_encode($data,JSON_UNESCAPED_UNICODE);
mysqli_close($conn);
?>